import { Controller, Get } from '@nestjs/common';
import { Crud } from 'nestjs-mongoose-crud'
import { Episode } from '@libs/db/models/episode.model'
import { InjectModel } from 'nestjs-typegoose';
import { ApiTags } from '@nestjs/swagger';
import { Course } from '@libs/db/models/course.model'


@Crud({
    model:Episode
})
@Controller('episodes')
@ApiTags('课时')
export class EpisodesController {
//     constructor(
//         @InjectModel(Episode) private readonly model,
//         @InjectModel(Course) private readonly courseModel
//     ){}

//     @Get('option')
//     async option(){
//         const courses = (await this.courseModel.find()).map(v=>({
//             label:v.name,
//             value:v._id
//         }))
//         return {
//             title:"课时管理",
//             translate:true,
//             column:[
//                 { prop:"course",label:"所属课程",dicData:courses,type:'select',row:true,span:20 },
//                 { prop:"name",label:"课时名称",span:20,row:true },
//                 { prop:"file",label:"视频文件",listType:'pictureImg',span:20,type:'upload',action:'/upload'}
//             ]
//         }
//     }
}
